<!--
 * @Description: 
 * @version: 
 * @Author: liurui
 * @Date: 2024-02-05 15:23:52
 * @LastEditors: 
 * @LastEditTime: 2024-02-05 15:49:23
-->
<template>
    <div>

    </div>
</template>

<script setup lang="ts">
// 将两个类型合并成一个类型，第二个类型的键会覆盖第一个类型的键

type foo = {
  name: string;
  age: string;
};

type coo = {
  age: number;
  sex: string;
};

type Result = Merge<foo, coo>; // expected to be {name: string, age: number, sex: string}

type Merge<F, S> = Omit<F, Extract<keyof S, keyof F>> & S;

type Result2 = Extract<foo, coo>

let eoo: Result = {
  name: '1',
  age: 1,
  sex: '1'
}
</script>

<style scoped>

</style>